package com.limeng.datastruts.dp;

public class Fib1 {

    public static void main(String[] args) {
        System.out.println(fib(64));
    }

    public static long fib(int index){
        if(index<2) return index;
        long[] nums = new long[index+1];
        nums[0]=0;
        nums[1]=1;
        for(int i=2;i<=index;i++){
            nums[i] = nums[i-1]+nums[i-2];
        }
        return nums[index];
    }
}
